class PageUtils {

  constructor () {
  }

  static page(current, size) {
    let pageUrl = ""
    if (current != null) {
      pageUrl = pageUrl + "current=" + current + "&"
    }
    if (size != null) {
      pageUrl = pageUrl + "size=" + size
    }
    return pageUrl;
  }

  static setPagination (obj, page, pagination) {
    let p = {
      page: page,
      id: pagination.id,
      total: pagination.total,
      current: pagination.current,
      size: pagination.size,
    }
    obj.$store.dispatch('savePagination', p)
  }

  static getPagination (obj, page) {
    obj.$store.state.Puba.pagination[page]
  }
}

export default PageUtils;